package pacman;

import java.io.IOException;
import java.util.Map;

import maze.Direction;
import maze.Location;

import org.junit.Test;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Command;
import com.rabbitmq.client.ConfirmListener;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.FlowListener;
import com.rabbitmq.client.GetResponse;
import com.rabbitmq.client.Method;
import com.rabbitmq.client.ReturnListener;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import com.rabbitmq.client.AMQP.BasicProperties;
import com.rabbitmq.client.AMQP.Basic.RecoverOk;
import com.rabbitmq.client.AMQP.Channel.FlowOk;
import com.rabbitmq.client.AMQP.Confirm.SelectOk;
import com.rabbitmq.client.AMQP.Exchange.BindOk;
import com.rabbitmq.client.AMQP.Exchange.DeclareOk;
import com.rabbitmq.client.AMQP.Exchange.DeleteOk;
import com.rabbitmq.client.AMQP.Exchange.UnbindOk;
import com.rabbitmq.client.AMQP.Queue.PurgeOk;
import com.rabbitmq.client.AMQP.Tx.CommitOk;
import com.rabbitmq.client.AMQP.Tx.RollbackOk;

import junit.framework.TestCase;

public class GameTest extends TestCase {

	public GameTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}
	@Test
	public void testDiscover(){
		Channel channel = new Channel() {
			
			@Override
			public void removeShutdownListener(ShutdownListener arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void notifyListeners() {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public boolean isOpen() {
				// TODO Auto-generated method stub
				return false;
			}
			
			@Override
			public ShutdownSignalException getCloseReason() {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public void addShutdownListener(ShutdownListener arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void waitForConfirmsOrDie() throws IOException, InterruptedException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public boolean waitForConfirms() throws InterruptedException {
				// TODO Auto-generated method stub
				return false;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Tx.SelectOk txSelect() throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public RollbackOk txRollback() throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public CommitOk txCommit() throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public void setDefaultConsumer(Consumer arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public Command rpc(Method arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public boolean removeReturnListener(ReturnListener arg0) {
				// TODO Auto-generated method stub
				return false;
			}
			
			@Override
			public boolean removeFlowListener(FlowListener arg0) {
				// TODO Auto-generated method stub
				return false;
			}
			
			@Override
			public boolean removeConfirmListener(ConfirmListener arg0) {
				// TODO Auto-generated method stub
				return false;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.UnbindOk queueUnbind(String arg0,
					String arg1, String arg2, Map<String, Object> arg3)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.UnbindOk queueUnbind(String arg0,
					String arg1, String arg2) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public PurgeOk queuePurge(String arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.DeleteOk queueDelete(String arg0,
					boolean arg1, boolean arg2) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.DeleteOk queueDelete(String arg0)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.DeclareOk queueDeclarePassive(
					String arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.DeclareOk queueDeclare(String arg0,
					boolean arg1, boolean arg2, boolean arg3, Map<String, Object> arg4)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.DeclareOk queueDeclare()
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.BindOk queueBind(String arg0,
					String arg1, String arg2, Map<String, Object> arg3)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public com.rabbitmq.client.AMQP.Queue.BindOk queueBind(String arg0,
					String arg1, String arg2) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public long getNextPublishSeqNo() {
				// TODO Auto-generated method stub
				return 0;
			}
			
			@Override
			public FlowOk getFlow() {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public Consumer getDefaultConsumer() {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public Connection getConnection() {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public int getChannelNumber() {
				// TODO Auto-generated method stub
				return 0;
			}
			
			@Override
			public FlowOk flow(boolean arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public UnbindOk exchangeUnbind(String arg0, String arg1, String arg2,
					Map<String, Object> arg3) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public UnbindOk exchangeUnbind(String arg0, String arg1, String arg2)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeleteOk exchangeDelete(String arg0, boolean arg1)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeleteOk exchangeDelete(String arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeclareOk exchangeDeclarePassive(String arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeclareOk exchangeDeclare(String arg0, String arg1, boolean arg2,
					boolean arg3, boolean arg4, Map<String, Object> arg5)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeclareOk exchangeDeclare(String arg0, String arg1, boolean arg2,
					boolean arg3, Map<String, Object> arg4) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeclareOk exchangeDeclare(String arg0, String arg1, boolean arg2)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public DeclareOk exchangeDeclare(String arg0, String arg1)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public BindOk exchangeBind(String arg0, String arg1, String arg2,
					Map<String, Object> arg3) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public BindOk exchangeBind(String arg0, String arg1, String arg2)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public SelectOk confirmSelect() throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public void close(int arg0, String arg1) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void close() throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void clearReturnListeners() {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void clearFlowListeners() {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void clearConfirmListeners() {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicReject(long arg0, boolean arg1) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicRecoverAsync(boolean arg0) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public RecoverOk basicRecover(boolean arg0) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public RecoverOk basicRecover() throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public void basicQos(int arg0, int arg1, boolean arg2) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicQos(int arg0) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicPublish(String arg0, String arg1, boolean arg2,
					boolean arg3, BasicProperties arg4, byte[] arg5) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicPublish(String arg0, String arg1, BasicProperties arg2,
					byte[] arg3) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicNack(long arg0, boolean arg1, boolean arg2)
					throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public GetResponse basicGet(String arg0, boolean arg1) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public String basicConsume(String arg0, boolean arg1, String arg2,
					boolean arg3, boolean arg4, Map<String, Object> arg5, Consumer arg6)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public String basicConsume(String arg0, boolean arg1, String arg2,
					Consumer arg3) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public String basicConsume(String arg0, boolean arg1, Consumer arg2)
					throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public String basicConsume(String arg0, Consumer arg1) throws IOException {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public void basicCancel(String arg0) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void basicAck(long arg0, boolean arg1) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void asyncRpc(Method arg0) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void addReturnListener(ReturnListener arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void addFlowListener(FlowListener arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void addConfirmListener(ConfirmListener arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void abort(int arg0, String arg1) throws IOException {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void abort() throws IOException {
				// TODO Auto-generated method stub
				
			}
		};
		Game game = new Game();
		Ghost ghost1 = new Ghost(new Location(0,0), 0, "jos");
		Ghost ghost2 = new Ghost(new Location(1,1), 0, "Jef");
		Ghost[] ghosts = {ghost1, ghost2};
		ghost1.getMaze().addBarcode(1, 1, "01011100", 0);
		ghost2.getMaze().addBarcode(0, 0, "01011100", 0);
		game.setGhosts(ghosts);
		game.processDISCOVER("Jef", 5, 5, 1, 2, 1, 2);
		System.out.println("juiste pos:" + ghost1.getMaze().read(4, 4, Direction.NORTH, true));
		System.out.println("foute pos:" + ghost1.getMaze().read(5, 5, Direction.NORTH, true));
		//assertEquals(1, ghost1.getMaze().read(4, 4, Direction.NORTH, true));
		assertEquals(1, ghost1.getMaze().read(5, 5, Direction.NORTH, true));
	}

}
